package com.zhiyou.app.shop.manager.dao.pojo;

import java.util.ArrayList;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

/**
 * GoodsOrder entity. @author MyEclipse Persistence Tools
 */

public class GoodsOrder extends com.zhiyou.app.shop.manager.dao.pojo.BasePojo implements java.io.Serializable {

	private static final long serialVersionUID = 1L;
	private UserDetail userDetail;
	private PayOrder payOrder;
	private Shop shop;
	private Boolean isPay;
	private Integer payMode;
	private Boolean isDelivery;
	private Boolean isReceipt;
	private Float orderPrice;
	private String memo;
	private Date createDate;
	private Set orderDetails = new HashSet(0);

	//for view
	private String orderStatus;
	
	// Constructors

	/** default constructor */
	public GoodsOrder() {
	}



	public GoodsOrder(UserDetail userDetail, PayOrder payOrder, Shop shop,
			Boolean isPay, Integer payMode, Boolean isDelivery,
			Boolean isReceipt, Float orderPrice, String memo, Date createDate,
			Set orderDetails) {
		super();
		this.userDetail = userDetail;
		this.payOrder = payOrder;
		this.shop = shop;
		this.isPay = isPay;
		this.payMode = payMode;
		this.isDelivery = isDelivery;
		this.isReceipt = isReceipt;
		this.orderPrice = orderPrice;
		this.memo = memo;
		this.createDate = createDate;
		this.orderDetails = orderDetails;
	}



	public UserDetail getUserDetail() {
		return userDetail;
	}

	public void setUserDetail(UserDetail userDetail) {
		this.userDetail = userDetail;
	}

	public PayOrder getPayOrder() {
		return payOrder;
	}

	public void setPayOrder(PayOrder payOrder) {
		this.payOrder = payOrder;
	}

	public Shop getShop() {
		return shop;
	}

	public void setShop(Shop shop) {
		this.shop = shop;
	}

	public Boolean getIsPay() {
		return this.isPay;
	}

	public void setIsPay(Boolean isPay) {
		this.isPay = isPay;
	}

	public Integer getPayMode() {
		return this.payMode;
	}

	public void setPayMode(Integer payMode) {
		this.payMode = payMode;
	}

	public Boolean getIsDelivery() {
		return this.isDelivery;
	}

	public void setIsDelivery(Boolean isDelivery) {
		this.isDelivery = isDelivery;
	}

	public Boolean getIsReceipt() {
		return this.isReceipt;
	}

	public void setIsReceipt(Boolean isReceipt) {
		this.isReceipt = isReceipt;
	}

	public Float getOrderPrice() {
		return orderPrice;
	}

	public void setOrderPrice(Float orderPrice) {
		this.orderPrice = orderPrice;
	}


	public Date getCreateDate() {
		return this.createDate;
	}

	public String getMemo() {
		return memo;
	}

	public void setMemo(String memo) {
		this.memo = memo;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	public Set getOrderDetails() {
		return this.orderDetails;
	}

	public void setOrderDetails(Set orderDetails) {
		this.orderDetails = orderDetails;
	}


	public String getOrderStatus() {
		String text = "shopManage.shopOrder.complete";
		if(this.isPay==false){
			text = "shopManage.shopOrder.waitForPay";
		}else if(this.isPay==true && this.isDelivery==false){
			text = "shopManage.shopOrder.waitForDeliverGoods";
		}else if(this.isDelivery==true && this.isReceipt==false){
			text = "shopManage.shopOrder.waitForReceive";
		}
		return text;
	}

}